package viewControllers.robot;

import graphics.GraphicalObject;
import viewControllers.AnimationPart;

public class Torso extends AnimationPart{

		double up_frame = 0;//0.01;
		double up_limit = 0.05; 
		double up = 0;
		int direction = 1;
		
		public Torso(GraphicalObject object) {
			super(object);
		}

		@Override
		public void play(int frame) {
			if (up > up_limit)
				direction = -1;
			if (up < -up_limit)
				direction = 1;
			up += up_frame * direction;
			position.rotate(up_frame * direction, 0, 0);
			position.getCenter().y += up;
		}

}
